package com.treasure.mall.biz.dto.condition;

import com.treasure.mall.biz.dto.BaseSearchDTO;
import com.treasure.mall.zbq.common.ienum.base.CodeDescEnumHelper;
import com.treasure.mall.zbq.common.ienum.marketing.RedPacketEnums;
import lombok.Data;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/8/2
 */
@Data
public class RedPacketCondition implements BaseSearchDTO {
    private static final long serialVersionUID = -57286198804480991L;

    private String title;
    private String startBegin;
    private String startEnd;
    private String merchantKey;
    private int status = -1;


    public RedPacketEnums.Status getRedStatus() {
        if (status == -1) {
            return null;
        }
        RedPacketEnums.Status redStatus = CodeDescEnumHelper.getEnumTypeByCode(RedPacketEnums.Status.class, status);
        if (redStatus != null) {
            return redStatus;
        }
        return null;
    }


}
